﻿<UserControls:ScrumUserControl 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:Controls="clr-namespace:Microsoft.Surface.Presentation.Controls;assembly=Microsoft.Surface.Presentation"
    xmlns:CustomControl1="clr-namespace:ScrumTable.UI.View.CustomControl;assembly=ScrumTable.UI.View" 
    xmlns:Localization="clr-namespace:ScrumTable.UI.View.Localization;assembly=ScrumTable.UI.View" xmlns:UserControl="clr-namespace:ScrumTable.UI.View.Controls;assembly=ScrumTable.UI.View" xmlns:UserControls="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls" xmlns:Converter="clr-namespace:ScrumTable.UI.View.Converter;assembly=ScrumTable.UI.View" xmlns:Interop2="clr-namespace:ScrumTable.UI.View.WinTouch.Win32Interopt"   xmlns:forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" xmlns:Interop="clr-namespace:ScrumTable.UI.View.WinTouch.Win32Interopt.Interop" xmlns:Tool="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls.Tool" x:Class="ScrumTable.UI.View.WinTouch.UserControls.Tool.WpfReportSelector"	x:Name="UserControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="White" Width="800" Height="600">
    <UserControls:ScrumUserControl.Resources>       
        <DataTemplate x:Key="ComboBoxDataTemplate">         
            <TextBlock  HorizontalAlignment="Left" FontSize="12" FontWeight="Bold" Height="24">
                <TextBlock.Text>
                    <Binding Path="Name" />
                </TextBlock.Text>
            </TextBlock>
        </DataTemplate>
        <Converter:ConverterListCountVisibility Invert="True" x:Key="ConverterCount"/>
    </UserControls:ScrumUserControl.Resources>
    <Grid>
        <Grid.Resources>
            <Converter:ConverterIsNullVisibility x:Key="IsNullVisbilityConverter"/>
            <Converter:ConverterIsEmptyString x:Key="CheckStringEmpty"/>
            <Style  TargetType="{x:Type GroupBox}">
                <Setter Property="Margin" Value="10,5,10,5"/>
                <Setter Property="Padding" Value="5"/>
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="HeaderTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding}" Foreground="Black" FontWeight="Bold"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style  TargetType="{x:Type Controls:SurfaceCheckBox }">
                <Setter Property="Margin" Value="0,2,0,2"/>
            </Style>            
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>            
            <ColumnDefinition Width="*"/>            
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>            
            <RowDefinition Height="Auto"></RowDefinition>            
            <RowDefinition Height="*"></RowDefinition>            
        </Grid.RowDefinitions>
      
        <Grid Background="{StaticResource ListBoxBackgroundGrayHorizontal}" Opacity="0.5" Grid.RowSpan="3" Grid.Row="0"></Grid>
        
        <Controls:SurfaceListBox ItemsSource="{Binding ScrumData.CurrentProject.Reports}" SelectionChanged="OnReportListSelectionChanged" x:Name="ReportList" Grid.RowSpan="3" Grid.Row="0">
            <Controls:SurfaceListBox.ItemTemplate>
                <DataTemplate>
                    <Label Content="{Binding Name}"/>
                </DataTemplate>
            </Controls:SurfaceListBox.ItemTemplate>
        </Controls:SurfaceListBox>
        <Grid Grid.Row="0" Grid.Column="1" Name="PropertyGrid"></Grid>
        
        <CustomControl1:WebAsyncImage ClipWhiteBorderRightBottom="True" Grid.Row="1" Background="White"  x:Name="AsyncImage" Visibility="{Binding Path=SelectedItem, ElementName=ReportList, Converter={StaticResource IsNullVisbilityConverter}}" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"></CustomControl1:WebAsyncImage>

        <Controls:SurfaceButton HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5"  Opacity="0.6" MinHeight="20"  Grid.Column="1" Grid.Row="1" FontSize="26" Click="OnGenerateClick" Visibility="{Binding Path=SelectedItem, ElementName=ReportList, Converter={StaticResource IsNullVisbilityConverter}}">
            <UserControl Background="{StaticResource Generate}"  IsHitTestVisible="False"  Width="40" Height="40"/>
        </Controls:SurfaceButton>

        <Label HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" Grid.Row="1" Grid.Column="1" FontSize="50" FontWeight="Bold"  Visibility="{Binding ScrumData.CurrentProject.Reports.Count, Converter={StaticResource ConverterCount}}" Content="{Localization:Translate Uid=Report_No_Report,Default=[NoReport]}"/>

    </Grid>
</UserControls:ScrumUserControl>    